<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>mouse_action</title>
    <style>
        .global{
            width: 400px;
            height: 400px;
            background: aqua;
            text-align: center;
            margin: 0 auto;
            margin-top: 10px;
            padding: 10px;
			top: 25%;
			position: fixed;
			float: right;
			right: 36%;
        }
        img{
            margin-top: 20px;
            
        }
        input{
            height: 30px;
            width: 200px;
        }
        hr{
            color:white;
			border-radius: 400px;
			border-color: white;
        }
    </style>
    <script>
        function $(id){
            return document.getElementById(id);
        }
        function mouseOver(){
            $("image").src="1.png"
            $("global").style.background="green";
          
        }
        function mouseOut(){
            $("image").src="1.png";
            $("global").style.background="aqua";
        }
        function Click(){
            $("image").src="2.png";
            $("input-text").value="鼠标单击";
            $("global").style.background="cyan";  
        }
        function dblclick(){
            $("image").src="3.png";
            $("input-text").value="鼠标双击";
            $("global").style.background="aliceblue";  
        }
    </script>
</head>
<body>
    <div class="global" id="global" onmouseover="mouseOver()" onmouseout="mouseOut()" ondblclick="dblclick()" onclick="Click()">
        <h1> 鼠标动件捕获与响应</h1>
        <hr />
        <input type="text" id="input-text">
        <img src="1.png" alt="" id="image" >
    </div>
</body>
</html>
